home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / basupd / chdrive.asm < prev    next >
Assembly Source File  |  1992-06-18  |  1KB  |  38 lines

  1. ;   +----------------------------------------------------------------------+
  2. ;   |                                                                      |
  3. ;   |           BasUpd  Copyright (c) 1992  Thomas G. Hanlin III           |
  4. ;   |                                                                      |
  5. ;   |            See BASUPD.DOC for info on distribution policy            |
  6. ;   |                                                                      |
  7. ;   +----------------------------------------------------------------------+
  8.  
  9.  
  10.  
  11. public  CHDRIVE
  12.  
  13.  
  14.  
  15. .model medium
  16. .CODE
  17.  
  18.  
  19.  
  20. CHDRIVE       proc           far       ; change default drive
  21.               mov            bx,sp          ;
  22.               mov            bx,4[bx]       ; drive letter
  23.               mov            cx,[bx]        ;
  24.               mov            bx,2[bx]       ;
  25.               mov            dl,[bx]        ;
  26.               jcxz           Done           ;   exit if null drive string
  27.               and            dl,1Fh         ; convert drive letter to number
  28.               dec            dx             ;
  29.               mov            ah,0Eh         ;
  30.               int            21h            ; set default drive
  31. Done:         ret            2              ;
  32. CHDRIVE       endp                     ; change default drive
  33.  
  34.  
  35.  
  36.  
  37.               end
  38.